<?php 
	if (isset($_GET['id_journal'])) {
		$data=$this->getJournal($_GET['id_journal']);
	}
	else 
		$data = $this->getRequest()->getPost();
?>
<div class="grid_10">
	<div class="box round first fullpage">
		<?php if (isset($_GET['id_journal'])):?>
			<h2>Edit Journal</h2>
		<?php else:?>
			<h2>Add Journal</h2>
		<?php endif;?>
		<div class="block ">
			<form action="<?php echo Epic::getUrl('admin/journal/addJournal')?>" method="post" enctype="application/x-www-form-urlencoded">
			<table class="form">
				<tbody>
				<tr>
					<td>
						<label>
							Name Journal
						</label>
					</td>
					<td>
						<?php if (isset($_GET['id_journal'])):?>
							<input type="hidden" class="" name="id_journal" value="<?php echo $_GET['id_journal']?>">
						<?php endif;?>
						<input type="text" class="large" name="name" value="<?php  if (isSet($data['name']))echo $data['name']?>"><span style="color: red;">*</span>
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Subject 
						</label>
					</td>
					<td>
						<input type="text" class="large" name="subject" value="<?php  if (isSet($data['subject'])) echo $data['subject']?>"><span style="color: red;">*</span>
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Contact</label>
					</td>
					<td>
						<input type="text" class="large" name="contact" value="<?php if (isSet($data['contact']))echo $data['contact']?>">
					</td>
				</tr>
				<tr>
					<td>
						<label>
							Issn</label>
					</td>
					<td>
						<input type="int" class="mini" name="issn" value="<?php if (isSet($data['issn'])) echo $data['issn']?>">
					</td>
				</tr>
				
				<tr>
					<td>
						<label>
							Image</label>
					</td>
					<td>
						<input type="file" name="image" value="<?php if(isSet($data['image'])) echo $data['image']?>">
					</td>
				</tr>
				<tr>
					<td style="vertical-align: top; padding-top: 9px;">
						<label>
							Description</label>
					</td>
					<td>
						<textarea class="" style="width: 773px; height: 144px;"name="description"  ><?php if(isSet($data['description'])) echo $data['description']?></textarea>
					</td>
				</tr>
				<tr>
					<td style="vertical-align: top; padding-top: 9px;">
						<label>
							</label>
					</td>
					<td>
						<button class="btn" type="submit">Submit</button>
					</td>
				</tr>
				
			</tbody></table>
			</form>
			<a href="<?php echo Epic::getUrl('admin/journal/list');?>"> Back to list </a>
		</div>
	</div>
</div>